GetGroup Method

Syntax

GetGroups as P (groupName as C, includeUsers as L, ou as C)

Arguments

groupNameCharacter

The name of the group to get.

includeUsersLogical

Set to .T. to include the list of users in the group objects that are returned. Defaults to .F.

Including users could make this method run for a long time.

ouCharacter

The name of an organizational unit from which to restrict the list of groups. Defaults to empty string.

Returns

groupWindowsServices::ActiveDirectory::Group (use as type P)

Returns a WindowsServices::ActiveDirectory::Group object. Check the domain object's CallResult to see if the method succeeds.

Description

Get the group for a WindowsServices::ActiveDirectory::Domain object. Optionally include the users in the groups and optionally restrict the search for the group to a specific organizational unit.

'The follow line assumes that the machine is joined to an Active Directory domain and is allow to query Active Directory.
dim domain as WindowsServices::ActiveDirectory::Domain = new WindowsServices::ActiveDirectory::Domain()
if .not. domain.CallResult.Success then
	?"There was an error connecting to an Active Directory domain: " + domain.CallResult.Text + crlf()
	goto exitTestFunction
end if
	
?"The domain name is " + domain.Name + crlf()

dim groupName as c = "AppAdmin"
dim group as p = domain.getGroups(groupName, .f., "")
if .not. domain.CallResult.Success then
	?"There was an error getting the group " + groupName + ": " + domain.CallResult.Text + crlf()
	goto exitTestFunction
end if

?group.DistingishedName + crlf()
	
exitTestFunction: